/*
angular.module('moti.controllers.lineslist', ['moti.services.regionsService', 'moti.services.linesService'])
    .controller('linesListCtrl', ['$scope', 'RegionsInterface', 'LinesInterface', function($scope, RegionsInterface, LinesInterface){

        //搜索事件
        $scope.searchLines = function(){
            $scope.isLoading = true;
            //搜索接口
            LinesInterface.getLinesList($scope.search_obj).then(function(data){
                $scope.lines = data;
                $scope.isLoading = false;
                //根据景区id获取景区名称
                angular.forEach($scope.lines, function(value, key) {
                    value.region_desc = _.result(_.find($scope.regions, function(chr) {
                        return chr.region_id == value.region_id;
                    }), 'name');
                    value.create_time = moment(value.create_time).format('YYYY-MM-DD');
                });
            });
        };

        //获取景区列表
        RegionsInterface.getRegionsList().then(function(data){
            $scope.regions = data;
            //搜索条件
            $scope.search_obj = {
                "from" : moment().format('YYYY-MM-DD'),
                "to" : moment().add(1, 'month').format('YYYY-MM-DD'),
                "region_id" : $scope.regions[0].region_id
            };
            $scope.searchLines();
        });

        //开启关闭路线
        $scope.lineSwitch = function(line){
            LinesInterface.putAdmin(line, {"is_closed" : !line.is_closed}).then(function(data){
                line.is_closed = !line.is_closed;
            });
        };

        //时间选择控件
        $('#time').val(moment().format('YYYY/MM/DD') + ' - ' + moment().add(1, 'month').format('YYYY/MM/DD')).daterangepicker({
            startDate : moment(),
            endDate : moment().add(1, 'month'),
            locale : {
                applyLabel : '确定',
                cancelLabel : '取消',
                fromLabel : '起始时间',
                toLabel : '结束时间',
                customRangeLabel : '自定义',
                daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
                    '七月', '八月', '九月', '十月', '十一月', '十二月' ]
            }
        }, function(start, end, label){
            $scope.search_obj.from = start.format('YYYY-MM-DD');
            $scope.search_obj.to = end.format('YYYY-MM-DD');
            //格式化日期显示框
            $('#time').val(start.format('YYYY/MM/DD') + ' - ' + end.format('YYYY/MM/DD'));
        });

    }]);*/
var linesList = Vue.component('linesList', { template: '#linesList'});